{{extend "Tables/layout.html"}}

{{block title}}uliweb-apijson demo: tables{{end title}}

{{block content_wrapper}}
{{include "vue/inc_apijson_table.html"}}
<card>
    <div style="min-height: 600px;">
        {{if role!="ADMIN":}}
        <div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_comapps.auth.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
        {{pass #if}}
        <div id="app" class='box'>
        <div class="box-body">
            <tabs v-model:value="tab_current" type="card">
                <tab-pane v-for="item in tabs" :key="item" :label="item" :name="item">
                    <apijson-table :model_name="item" :config="apijson_tables[item]"></apijson-table>
                </tab-pane>
            </tabs>
        </div>
        </div>
    </div>
</card>
{{end content_wrapper}}

{{block mainapp_vue}}
<script>
var vm = new Vue({
    el: '#mainapp',
    delimiters: ['{', '}'],
    data:{
        tab_current: null,
        tabs: {{=table_keys_json}},
        apijson_tables: {{=apijson_tables_json}}
    }
})
</script>
{{end mainapp_vue}}
